if __name__ == '__main__':
    numbers = {
        0:6,
        1:2,
        2:5,
        3:5,
        4:4,
        5:5,
        6:6,
        7:3,
        8:7,
        9:6,
    }
    for i in range(10,2500):
        numbers[i] = 0
        t = i
        while t>0:
            numbers[i]+=numbers[t%10]
            t//=10
    
    results = [0 for _ in range(2500)]
    for a in range(0,1111):
        for c in range(0,1111):
            results[numbers[a]+numbers[c]+numbers[a+c]]+=1
        
    n = int(input())
    print(f"{results[n-4]}")

